package main

import "fmt"

func main() {
	nums := []int{56, 1, 22, 23, 54, 16, 17, 9, 34}
	insertSort(nums)
	fmt.Println(nums)
}

func insertSort(nums []int) {
	for i := 1; i < len(nums); i++ {
		for j := i; j-1 >= 0 && nums[j] < nums[j-1]; j-- {
			nums[j], nums[j-1] = nums[j-1], nums[j]
		}
	}
}
